package org.uw.src.logic;

import util.MathHelper;

public class player extends entity{
	public String name = "gg";
	private inventory inv = new inventory();
	
	float head_pitch = 0;
	float head_yaw = 0;
	
	private static final float head_yaw_limit = 15;
	private static final float head_pitch_limit = 90;
	
	public player(float x, float y, float z) {
		super(x, y, z);
	}
	
	public void rotateHead(int pitch, int yaw) {
		head_pitch += pitch;
		head_yaw += yaw;
		
		if(pitch > head_pitch_limit | pitch < -head_pitch_limit) {
			head_pitch = MathHelper.sign(pitch)*head_pitch_limit;
		}
		if(yaw>head_yaw_limit | yaw<-head_yaw_limit) {
			rotate(0, MathHelper.sign(yaw)*MathHelper.delta(yaw, head_yaw_limit) , 0);
			head_yaw = MathHelper.sign(yaw)*head_yaw_limit;
		}
	}
	
	public float getHeadPitch() {
		return head_pitch;
	}
	
	public float getHeadYaw() {
		return head_yaw;
	}
	
	public void setHeadRotation(float h_pitch, float h_yaw) {
		head_pitch = h_pitch;
		head_yaw = h_yaw;
	}
	
	public float getTotalYaw() {
		return yaw+head_yaw;
	}
	
	public float getTotalPitch() {
		return pitch + head_pitch;
	}
	
	
	
	
	
}
